<%--
  Created by IntelliJ IDEA.
  User: 86187
  Date: 2021/3/13
  Time: 15:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
  if(request.getAttribute("vo") == null){
    String path = request.getServletContext().getContextPath();
    response.sendRedirect(path+"/user?op=index");
    return;
  }
%>
<html>
  <head>
    <title>$Title$</title>
  </head>


  <body>
  <form action="${pageContext.request.contextPath}/user" method="post">
    <input type="hidden" name="op" value="index"/>
    <table width="900px" border="1">
  <tr style="background-color:red;">
  <th>序号</th>
  <th>姓名</th>
  <th>手机</th>
  <th>QQ</th>
  <th>Email</th>
  <th>操作</th>
  </tr>
      <c:forEach items="${vo.pageUserInfo.data}" var="u">
        <tr>
          <td>${u.id}</td>
          <td>${u.mobile}</td>

          <td>${u.qq}</td>
          <td>${u.email}</td>
          <td>${u.address}</td>
        </tr>
      </c:forEach>
  </table>

  </form>
  <div>
    <span><a href="${pageContext.request.contextPath}/user?op=index&page=1">首页</a></span>
    <c:if test="${vo.pageUserInfo.hasPrevious}">
      <span><a href="${pageContext.request.contextPath}/user?op=index&page=${vo.pageUserInfo.pageIndex-1}">上一页</a></span>
    </c:if>
    <c:if test="${not vo.pageUserInfo.hasPrevious}">
      <span>上一页</span>
    </c:if>
    <c:if test="${vo.pageUserInfo.hasNext}">
      <span><a href="${pageContext.request.contextPath}/user?op=index&page=${vo.pageUserInfo.pageIndex+1}">下一页</a></span>
    </c:if>
    <c:if test="${not vo.pageUserInfo.hasNext}">
      <span>下一页</span>
    </c:if>
    <span><a href="${pageContext.request.contextPath}/user?op=index&page=${vo.pageUserInfo.totalPageCount}">尾页</a></span>
    <span>${vo.pageUserInfo.pageIndex}/${vo.pageUserInfo.totalPageCount}/${vo.pageUserInfo.totalCount}</span>
  </div>
  </body>
</html>
